const doSync = (sth, time) => new Promise(resolve => {
    setTimeout(() => {
        console.log(sth + "用了" + time + "毫秒")
        resolve()
    }, time)
})

const doAsync = (sth, time, cb) => {
    setTimeout(() => {
        console.log(sth + "用了" + time + "毫秒")
        cb && cb()
    }, time)
}

const doElse = (sth) => {
    console.log(sth)
}

const Meizi = { doSync, doAsync, doElse }
const Man = { doSync, doAsync }

    ; (async () => {
        console.log("case1:妹子来到卫生间")
        //同步
        await Man.doSync("男人刷牙", 1000)
        console.log("妹子一直等")
        await Meizi.doSync("妹子洗澡", 2000)
        Meizi.doElse("妹子去忙别的了")
        // 异步
        Man.doAsync("男人刷牙", 1000, function () {
            console.log("通知妹子卫生间空闲")
            Meizi.doAsync("妹子洗澡", 2000)
        })
        Meizi.doElse("妹子去忙别的了")
    })()